package StudyCode.summary.textfile;

import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ReadingAllLinesFileReturnedAsList {
	public static void main(String[] args) {
		try {
			Path path = Paths.get("E:/Copy/test1.txt");
			List<String> contents = Files.readAllLines(path, Charset.defaultCharset());
			for (String b : contents) {
				System.out.println(b);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
